<?php
registerTable("permission_group", new table_permission_group());

class table_permission_group extends Database
{

    public function __construct()
    {
        parent::__construct("permission_group");
    }

    public function fetch_all_by_gid($gid)
    {
        return $this->fetch_assoc("`gid`='$gid'");
    }

    public function fetch_all_by_groupname($groupname)
    {
        return $this->fetch_assoc("`groupname`='$groupname'");
    }

    public function fetch_permissions_by_gid($gid)
    {
        return $this->fetch_assoc("`gid`='$gid'", "permissions,extends");
    }

    public function fetch_permissions_by_groupname($groupname)
    {
        return $this->fetch_assoc("`groupname`='$groupname'", "permissions,extends");
    }
    
}
?>